package bigdata.mysql;

import java.sql.*;

public class MysqlTest {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://master:3306/test", "root", "123456");

        String sql = "select * from emp";
        Statement s = conn.createStatement();
        ResultSet rs = s.executeQuery(sql);

        while (rs.next()){
            String E = rs.getString("sal");
            System.out.println(E);
        }

        rs.close();
        s.close();
        conn.close();


    }


}
